export type MessageTypes =  'primary' | 'success' | 'error' | 'info' | 'warning'

export const DEFAULT_MESSAGE_TYPE: MessageTypes = 'primary'

export interface MessageOptionsType {
    type?: MessageTypes // 类型
    time?: number // 展示时间 ms
}
// 消息状态枚举
export enum MessageStatus {
    InQueue = 0,   // 在队列中
    Displaying = 1 // 正在展示
}

// 用于将某个类型的只读属性变为可变（非只读）
export type Mutable<T> = { -readonly [key in keyof T]: T[key] }
export const mutable = <T extends readonly any[] | Record<string, unknown>>(
    val: T
) => val as Mutable<typeof val>


export interface MessageProps {
    id: number
}

export type MessageOptions = Partial<
    Omit<MessageProps, 'id'> & {
        appendTo?: HTMLElement | string
    }
>
